/* =============================================================
   tech-courses.css
   Namespaced to .courses-section / #courses-section
   Three breakpoint layers — no duplicate declarations
   ============================================================= */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --tc-bg: #08080a;
  --tc-muted: #bfc0c6;
  --tc-accent1: #5ea2ff;
  --tc-accent2: #b36bff;
  --tc-max: 1200px;
  --tc-divider: linear-gradient(
    to bottom,
    rgba(255, 90, 90, 0),
    rgba(255, 60, 60, 0.95),
    rgba(255, 90, 90, 0)
  );
}

/* ── Base resets ────────────────────────────────────────────── */
.courses-section,
#courses-section {
  box-sizing: border-box;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #fff;
}
.courses-section *,
.courses-section *::before,
.courses-section *::after {
  box-sizing: inherit;
}
.courses-section img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ── Section shell ──────────────────────────────────────────── */
.courses-section {
  background: transparent;
  padding: 36px 20px;
}

/* ── Header ─────────────────────────────────────────────────── */
.courses-header {
  max-width: 1100px;
  margin: 5rem auto 18px;
  text-align: center;
}
.courses-title {
  font-size: clamp(3.5rem, 5.5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin-bottom: 1.1rem;
  animation: float-up 0.5s ease-out 0.08s both;
}
.courses-gradient {
  background: linear-gradient(90deg, var(--tc-accent1), var(--tc-accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.courses-subtitle {
  max-width: 880px;
  margin: 0 auto;
  color: var(--tc-muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.55;
}

/* ── Wrapper + red divider (desktop only) ───────────────────── */
.courses-wrapper {
  max-width: var(--tc-max);
  margin: 28px auto 0;
  display: flex;
  flex-direction: column;
  gap: 42px;
  position: relative;
  padding: 0 120px;
}
.courses-wrapper::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  width: 3px;
  margin: 0 auto;
  background: var(--tc-divider);
  box-shadow: 0 0 18px rgba(255, 60, 60, 0.12);
  border-radius: 999px;
  pointer-events: none;
}

/* ── Course block ───────────────────────────────────────────── */
.course-block {
  display: grid;
  grid-template-columns: 1fr 450px;
  gap: 36px;
  align-items: center;
}
.course-block.course-right {
  grid-template-columns: 450px 1fr;
}

/* ── Course info ────────────────────────────────────────────── */
.course-info {
  display: flex;
  flex-direction: column;
}

/* Left-side block: info aligns right */
.course-block:not(.course-right) .course-info {
  align-items: flex-end;
  text-align: right;
  padding-right: 36px;
}
.course-block:not(.course-right) .course-tags {
  justify-content: flex-end;
}

/* Right-side block: info aligns left */
.course-block.course-right .course-info {
  align-items: flex-start;
  text-align: left;
  padding-left: 36px;
}

/* ── Tag pill (category label) ──────────────────────────────── */
.course-tag {
  display: inline-block;
  padding: 10px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  background: linear-gradient(90deg, #22263a, #3b2a55);
}
.course-tag.course-tag-alt {
  background: linear-gradient(90deg, #40233d, #6f2b5f);
}

/* ── Course copy ────────────────────────────────────────────── */
.course-heading {
  margin: 14px 0 8px;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
}
.course-description {
  margin: 0 0 14px;
  color: var(--tc-muted);
  max-width: 700px;
  line-height: 1.55;
  font-size: 0.95rem;
}

/* ── Tech tags list ─────────────────────────────────────────── */
.course-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.tag {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  font-weight: 600;
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.tag-blue {
  background: linear-gradient(90deg, #1d4ed8, #2563eb);
  color: #fff;
  border: none;
}
.tag-purple {
  background: linear-gradient(90deg, #4c2d6f, #8c3db2);
  color: #fff;
  border: none;
}
.tag-pink {
  background: linear-gradient(90deg, #9b2c89, #f43f5e);
  color: #fff;
  border: none;
}

/* ── Visual frame ───────────────────────────────────────────── */
.course-visual {
  display: flex;
  justify-content: center;
}
.course-frame {
  border-radius: 20px;
  padding: 16px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02),
    rgba(255, 255, 255, 0.01)
  );
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.course-frame img {
  width: 520px;
  height: 340px;
  object-fit: cover;
  border-radius: 12px;
}
.course-frame.course-frame-alt img {
  width: 500px;
}

/* ── CTA button ─────────────────────────────────────────────── */
.course-btn {
  margin-top: 20px;
  display: inline-block;
  padding: 12px 58px;
  background: #fff;
  color: #000;
  font-size: 15px;
  font-weight: 700;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  text-decoration: none;
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease;
}
.course-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

/* =============================================================
   TABLET  600px – 1024px
   Only properties that CHANGE from base are declared here.
   ============================================================= */
@media (min-width: 600px) and (max-width: 1024px) {
  /* Hide red divider; blocks get individual card treatment */
  .courses-wrapper::after {
    display: none;
  }

  .courses-wrapper {
    padding: 0 40px;
    gap: 36px;
  }

  .course-block {
    grid-template-columns: 1fr 440px;
    gap: 28px;
    padding: 20px;
    border-radius: 14px;
    background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.012),
      rgba(255, 255, 255, 0.01)
    );
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    transition:
      transform 0.18s ease,
      box-shadow 0.18s ease;
  }
  .course-block:hover {
    transform: translateY(-4px);
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.48);
  }

  .course-block.course-right {
    grid-template-columns: 440px 1fr;
  }

  .course-frame img {
    width: 420px;
    height: 300px;
  }
  .course-frame.course-frame-alt img {
    width: 400px;
  }

  .course-block:not(.course-right) .course-info {
    padding-right: 18px;
  }
  .course-block.course-right .course-info {
    padding-left: 18px;
  }

  /* Tablet CTA — blue pill style */
  .course-btn {
    padding: 12px 22px;
    background: linear-gradient(90deg, #1d4ed8, #2563eb);
    color: #fff;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.12);
  }
  .course-btn:hover {
    box-shadow: 0 20px 50px rgba(37, 99, 235, 0.2);
  }
}

/* Larger tablet sub-breakpoint — only the column widths change */
@media (min-width: 900px) and (max-width: 1024px) {
  .courses-wrapper {
    padding: 0 60px;
    max-width: 1100px;
  }

  .course-block {
    grid-template-columns: 1fr 480px;
    gap: 32px;
  }
  .course-block.course-right {
    grid-template-columns: 480px 1fr;
  }

  .course-frame img {
    width: 480px;
    height: 320px;
  }
  .course-frame.course-frame-alt img {
    width: 460px;
  }
}

/* =============================================================
   MOBILE  < 600px
   ============================================================= */
@media (max-width: 599px) {
  .courses-section {
    padding: 40px 16px;
  }

  /* Hide desktop red divider */
  .courses-wrapper::after {
    display: none;
  }

  .courses-wrapper {
    padding: 0;
    gap: 24px;
  }

  /* Stack all blocks to single column, image below text */
  .course-block,
  .course-block.course-right {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 18px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
  }

  /* On mobile, image always comes first */
  .course-block .course-visual {
    order: -1;
  }
  .course-block.course-right .course-visual {
    order: -1;
  }

  /* Reset all directional alignment to centered */
  .course-block:not(.course-right) .course-info,
  .course-block.course-right    .course-info {
    align-items: flex-start;
    text-align: left;
    padding: 0;
  }
  .course-block:not(.course-right) .course-tags,
  .course-block.course-right .course-tags {
    justify-content: flex-start;
  }

  .course-frame img,
  .course-frame.course-frame-alt img {
    width: 100%;
    height: 200px;
  }

  .course-btn {
    width: 100%;
    text-align: center;
    padding: 13px 20px;
  }
}
